package com.ddd.mill.query.attributevalue;



import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ddd.mill.api.attribute.dto.response.response.AttributeValueListDto;
import com.ddd.mill.domain.aggregate.attributevalue.entity.AttributeValue;
import com.ddd.mill.infrastructure.persistent.dao.attributevalue.AttributeValueDao;

import com.ddd.mill.infrastructure.utils.TypeConvertUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class AttributeValueQueryServiceMyBatisServiceImpl extends ServiceImpl<AttributeValueDao, AttributeValue> implements AttributeValueQueryService {

    @Override
    public List<AttributeValueListDto> attributeValueList(Long attributeId) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("attribute_id", attributeId);
        return TypeConvertUtils.convert(this.list(queryWrapper), AttributeValueListDto.class);
    }
}
